<!-- 开考列表》选择考生 -->
<div class="layuimini-container layuimini-page-anim">
  <div class="layuimini-main">
    <blockquote class="site-text layui-elem-quote">
      <h2 class="u-m-b-10">淮南职业技术学院</h2>
      <h4 class="u-m-b-10">考试时间：2021-07-07</h4>
      <h4 class="u-m-b-10">具体时间：8:00-9:00</h4>
      <h4>考场编号：1</h4>
    </blockquote>
    <table class="layui-hide" id="detailsTable" lay-filter="currentTableFilter"></table>
  </div>
</div>

<!--添加按钮-->
<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
    <button class="layui-btn layui-btn-normal data-add-btn layui-btn-sm" lay-event="add">确认选择</button>
  </div>
</script>

<script>
  var tableData = [
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    },
    {
      'id': 10000,
      name: '小明',
      idCard: '3424000000',
      img: 'http://placehold.it/350x200',
      type: 'B',
      count: '3424000000',
      jigou: '小明',
      beizhu: '无'
    }
  ]
  layui.use(['form', 'table', 'miniPage', 'element', 'laydate'], function () {
    var $ = layui.jquery,
      table = layui.table

    table.render({
      elem: '#detailsTable',
      data: tableData,
      toolbar: '#toolbarDemo',
      cols: [[
        { type: 'checkbox'},
        { field: 'id', title: 'ID'},
        { field: 'idCard', title: '准考证号' },
        { field: 'name', title: '姓名' },
        { field: 'sex', title: '性别' },
        { field: 'idCard', title: '身份证号' },
        { field: 'phone', title: '联系电话' },
        { field: 'phone', title: '报考类型' },
        { field: 'phone', title: '所属单位' },
        { field: 'phone', title: '所在区域' },
        { field: 'phone', title: '职位' }
      ]],
      page: true,
      skin: 'line'
    })

    // 确认选择
    table.on('toolbar(currentTableFilter)', function (obj) {
      if (obj.event === 'add') {
        layer.confirm('监听确认选中按钮', function (index) {
          layer.close(index)
        })
      }
    })
  })
</script>
